package cn.topcodes.tcsf.admin.web.controller;

import cn.topcodes.tcsf.admin.commons.api.domain.ApiResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 功能性开放接口
 */
@Api(tags = {"通用功能性接口"})
@RestController
@RequestMapping("/api/function")
public class FunctionRestApi {

    @ApiOperation("获取图形验证码")
    @RequestMapping(value = "captcha",method = RequestMethod.GET)
    public void captcha() {

    }

    @ApiOperation("发送验证短信")
    @RequestMapping(value = "send-verify-sms",method = RequestMethod.POST)
    public ApiResponseEntity sendVerifySms(
            @RequestParam(required = true) String tel
    ) {

        return ApiResponseEntity.buildOK();
    }

    @ApiOperation("验证短信结果")
    @RequestMapping(value = "verify-sms",method = RequestMethod.POST)
    public ApiResponseEntity verifySms(
            @RequestParam(required = true) String tel,
            @RequestParam(required = true) String code
    ) {

        return ApiResponseEntity.buildOK();
    }
}
